from collections import Iterable

"""
isinstance(待检测对象,Iterable)
返回值： True 可迭代
        False 不可迭代
"""

ret = isinstance([1,2,3],Iterable)
print(ret)
print('#'*20)

ret = isinstance((1,2,3),Iterable)
print(ret)
print('#'*20)


ret = isinstance({"age":12,"name":'zhangsan'},Iterable)
print(ret)
print('#'*20)

# 100
ret = isinstance(100, Iterable)
print(ret)
print("--"*20)





# 自定义一个类
class MyClass(object):
    # 增加一个___iter__方法
    # 该方法就是一个迭代器

    def __iter__(self):
        pass

    
# 创建对象
myclass = MyClass()

ret = isinstance(myclass,Iterable)
print(ret)
print("---"*20)




























